package com.charge;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{

        Thread t = new Thread(){
        	public void run(){
//                while(true){
//                	if(this.isInterrupted())
//                		{System.out.println("-##!!!--->");
//                		  break;
//                		}                }
				System.out.println(this.getState());
//                while(true){
//                	if(Thread.interrupted())
//                		{System.out.println("-##--->");
//                		  break;
//                		}                }
        		try {
        			System.out.println("--------12!!!-------->"+Thread.currentThread().isInterrupted());
					Thread.sleep(5000);
					System.out.println("--------!!sleep!-------->"+Thread.currentThread().isInterrupted());
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					//e.printStackTrace();
					System.out.println("--------!!!-------->"+Thread.currentThread().isInterrupted());
					Thread.currentThread().interrupt();
					//System.out.println("--------e222----->");
					//System.out.println("---------------->"+this.isInterrupted());
				}
				System.out.println("--------!!!-------->"+Thread.currentThread().isInterrupted());

        	}
        };
        t.start();
        t.interrupt();

        Thread.sleep(7000);
        
        System.out.println("----12---->");
        //System.out.println(t.isInterrupted());
        System.out.println("----12---->");
	}

}
